package com.mxpio.erp.quality.service.impl;

import com.mxpio.erp.common.quality.entity.MoScrapOutFlowSum;
import com.mxpio.erp.common.quality.service.MoScrapOutFlowService;
import com.mxpioframework.jpa.JpaUtil;
import com.mxpioframework.jpa.query.Criteria;
import com.mxpioframework.jpa.query.Order;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;



@Service
public class MoScrapOutFlowServiceImpl implements MoScrapOutFlowService {

    @Override
    @Transactional(readOnly = true)
    public Page<MoScrapOutFlowSum> moScrapOutSum(Pageable pageAble) {
        Criteria criteria = Criteria.create();
        criteria.addOrder(new Order("quantity", true));
        return JpaUtil.linq(MoScrapOutFlowSum.class).where(criteria).paging(pageAble);
    }
}
